package com.example.shilehui;

import java.util.List;

import cn.jhc.Adapter.SelectCityAdapter;
import cn.jhc.Adapter.SelectProvincesAdapter;
import cn.jhc.bean.City;
import cn.jhc.bean.Province;
import cn.jhc.service.XMLPullService;
import cn.jhc.utils.Strings;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.Window;
import android.widget.ListView;

public class SelectCityActivity extends Activity {

	
	ListView cityList;
	List<City> citys;
	Province province;
	SelectCityAdapter selectCityAdapter;
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		
		super.onCreate(savedInstanceState);
		requestWindowFeature(Window.FEATURE_NO_TITLE);
		setContentView(R.layout.select_city);
		Intent intent=getIntent();
		province=(Province) intent.getSerializableExtra(Strings.SELECT_PROVINCE);
		try {
			citys=XMLPullService.getCity(province.getId());
			
			
			cityList=(ListView) findViewById(R.id.select_city_listview);
			selectCityAdapter=new SelectCityAdapter(this,this,province,citys);
			cityList.setAdapter(selectCityAdapter);
		} catch (Exception e) {
			e.printStackTrace();
		}
		
		
	}
	public void select_city_back(View v){
		finish();
	}
}
